Development of multi-threaded application remains a challenging task.
A compiler may present a model in which a programmer writes serial code, thus avoiding the complexities of parallel programming. A compiler may be able to transform code to execute in a parallelized and vectorized manner. For example, the compiler extracts the parallel/vector semantics out of the code and transforms the code.
However, a compiler can only transform the code if the compiler is able to validate that parallel execution would yield the same result as the serial execution. In many cases, a programmer's choice of programming language construct adds unnecessary serial restrictions and results in loops that cannot be optimized.